

<template>
  <el-container style="height: 100vh;">
    <!-- 侧边栏 -->
    <el-aside width="200px" style="background-color: #304156; box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);">
      <el-menu
          default-active="1"
          class="el-menu-vertical-demo"
          background-color="#304156"
          text-color="#fff"
          active-text-color="#ffd04b"
          :collapse="false"
      >
        <el-menu-item index="1">
          <i class="el-icon-menu"></i>
          <span>Dashboard</span>
        </el-menu-item>
        <el-menu-item index="2">
          <i class="el-icon-document"></i>
          <router-link to="/student" class="menu-link">学生管理</router-link>
        </el-menu-item>
        <el-menu-item index="3">
          <i class="el-icon-setting"></i>
          <router-link to="/teacher" class="menu-link">教师管理</router-link>
        </el-menu-item>
        <el-menu-item index="4">
          <i class="el-icon-user"></i>
          <router-link to="/course" class="menu-link">课程管理</router-link>
        </el-menu-item>
      </el-menu>
    </el-aside>

    <el-container>
      <!-- 顶部导航栏 -->
      <el-header style="background-color: #409EFF; color: #fff; line-height: 60px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);">
        <span style="font-size: 20px; font-weight: bold;">学校后台管理系统</span>
        <el-dropdown style="float: right;">
          <span class="el-dropdown-link" style="color: #fff; cursor: pointer;">
            Admin<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>个人中心</el-dropdown-item>
              <el-dropdown-item>退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </el-header>

      <!-- 主要内容区域 -->
      <el-main style="background-color: #f0f2f5; padding: 20px;">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "IndexView"
}
</script>

<style scoped>
/* 侧边栏菜单项样式 */
.el-menu-item {
  display: flex;
  align-items: center;
  padding: 0 20px !important;
}

.el-menu-item i {
  margin-right: 10px;
}

.el-menu-item:hover {
  background-color: #263445 !important;
}

/* 路由链接样式 */
.menu-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

/* 顶部导航栏下拉菜单样式 */
.el-dropdown-link {
  display: flex;
  align-items: center;
}

.el-dropdown-menu {
  margin-top: 5px;
}

.el-dropdown-menu__item {
  padding: 10px 20px;
}

/* 主要内容区域样式 */
.el-main {
  background-color: #f0f2f5;
  padding: 20px;
}
</style>